package com.hspedu.mhl.service;

import com.hspedu.mhl.dao.MenuDAO;
import com.hspedu.mhl.domain.Menu;

import java.util.List;

/**
 * @author lianghao
 * @create 2022-07-11 20:26
 */
public class MenuService {
    private MenuDAO menuDAO = new MenuDAO();

    public List<Menu> list (){
        return menuDAO.queryMulti("select id ,food_name name, food_class type, price from menu ;");
    }

    public Menu getMenuById(int id){
        return menuDAO.querySingle("select id ,food_name name, food_class type, price from menu where id = ? ;",id);
    }

}
